<?php

include '../../configs/global.php';
$data = $_POST;
$type= $data['type'];
$stem = $data['stem'];
$points=$data['points'];
$difficulty=$data['difficulty'];
$rid=$data['rid'];

$resourcesinfo=$data['resourcesinfo'];
$id=$data['id'];
$sql = "UPDATE questions SET type='$type',stem='$stem',difficulty='$difficulty',points='$points'  where id='$id'";
$sql1="UPDATE resources SET resourcesinfo='$resourcesinfo' where id='$rid'";


$r1 = $pdo->exec($sql);
$r2 = $pdo->exec($sql1);
if ($r1&&$r2) {
    header('location:/study/style/skip.php?url=admin/showcurriculum.php&info=修改成功！');
} else {
    header('location:/study/style/skip.php?url=admin/showcurriculum.php&info=修改失败,请稍后再试！');
}
// echo json_encode($ajax_res);
